package IC.Parser;

import java_cup.runtime.Symbol;

public class Token extends Symbol {
	
	private String name;
	private boolean isIdentifier;
	
	
    /**
     * 
     * @param line - line number
     * @param name - Token's name (type)
     * @param id - Symbol's ID
     * @param value - Token's value
     * @param isIdentifier - True iff the token is an identifier
     */
	public Token(int line,String name, int id, Object value,boolean isIdentifier )
	{
		super(id, line, 0, value);
		this.name = name;
		this.isIdentifier = isIdentifier;
	}

    
    public String toString(){
    	String str;
    	if (!isIdentifier)
    		str = this.left + ": " + name;
    	else str = this.left + ": " + name + "(" +  value + ")";
    	return str;

    }
    
    
}

